javascript linear serach